/* 基础样式 */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1, h2, h3 {
  color: #2c3e50;
}

/* 导航栏样式 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #34495e;
  padding: 15px 20px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.navbar ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.navbar ul li {
  margin-right: 20px;
}

.navbar ul li a {
  text-decoration: none;
  color: #ecf0f1;
  padding: 10px 15px;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.navbar ul li a:hover,
.navbar ul li a.active {
  background-color: #2c3e50;
}

.user-info {
  color: #ecf0f1;
  display: flex;
  align-items: center;
}

.logout-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 15px;
  transition: background-color 0.3s;
}

.logout-btn:hover {
  background-color: #c0392b;
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.card-header {
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.card-title {
  margin: 0;
  font-size: 1.5em;
}

/* 表单样式 */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 5px;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-row > div {
  flex: 1;
}

/* 按钮样式 */
button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
  display: block;
  width: 100%;
  margin-bottom: 10px;
}

button:hover {
  background-color: #2980b9;
}

button.danger {
  background-color: #e74c3c;
}

button.danger:hover {
  background-color: #c0392b;
}

button.secondary {
  background-color: #95a5a6;
}

button.secondary:hover {
  background-color: #7f8c8d;
}

button.small {
  padding: 5px 10px;
  font-size: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* 结果显示区域 */
pre {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 15px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  margin-top: 15px;
}

pre.success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

pre.error {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* 用户列表表格 */
.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.user-table th,
.user-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.user-table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.user-table tbody tr:hover {
  background-color: #f5f5f5;
}

.user-table tbody tr:nth-child(even) {
  background-color: #fbfbfb;
}

/* 页面切换 */
.page {
  display: block;
}

.page.hidden {
  display: none;
}

/* 调试面板 */
.debug-panel {
  position: fixed;
  right: 0; /* 定位在右侧边缘 */
  top: 0;
  width: 400px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #ddd;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%); /* 使用 transform 将其移出屏幕 */
  transition: transform 0.3s ease-in-out;
}

/* 使用独立的类名来控制调试面板的显示状态，避免与页面折叠冲突 */
.debug-panel.debug-panel-open {
  transform: translateX(0); /* 使用 transform 将其移回屏幕内 */
}

.debug-panel.collapsed {
  width: auto;
}

.debug-panel-header {
  padding: 10px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debug-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.debug-panel-content pre {
  font-size: 12px;
  padding: 5px;
  margin: 5px 0;
}

.debug-toggle-btn {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 1001;
}

.debug-panel-actions {
  padding: 10px;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 5px;
  background: #f5f5f5;
}

.debug-panel-actions button {
  padding: 5px 10px;
  font-size: 12px;
}

.debug-search-box {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  background: #f9f9f9;
}

.debug-search-box input, 
.debug-search-box select {
  width: 100%;
  padding: 5px;
  margin: 5px 0;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 12px;
  box-sizing: border-box;
}

.debug-search-controls {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.debug-search-controls button {
  flex: 1;
  padding: 5px;
  font-size: 12px;
}

.debug-entry {
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fafafa;
}

.debug-entry-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 13px;
}

.debug-entry-method {
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  color: white;
}

.debug-entry-method.GET { background-color: #4CAF50; }
.debug-entry-method.POST { background-color: #2196F3; }
.debug-entry-method.PUT { background-color: #FF9800; }
.debug-entry-method.DELETE { background-color: #F44336; }

.debug-entry-status {
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  color: white;
}

.debug-entry-status.status-200 { background-color: #4CAF50; }
.debug-entry-status.status-400 { background-color: #FF9800; }
.debug-entry-status.status-401 { background-color: #FF9800; }
.debug-entry-status.status-403 { background-color: #F44336; }
.debug-entry-status.status-404 { background-color: #F44336; }
.debug-entry-status.status-500 { background-color: #F44336; }

.debug-entry-url {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
  word-break: break-all;
}

.debug-entry-body, 
.debug-entry-response {
  margin-top: 5px;
  font-size: 12px;
}

.debug-entry pre {
  background: #f1f1f1;
  padding: 8px;
  border-radius: 3px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 11px;
  margin: 5px 0;
}

.debug-entry-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
}

.debug-entry-toggle {
  background: none;
  border: none;
  color: #2196F3;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
  margin-top: 5px;
}

.debug-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.debug-modal.hidden {
  display: none;
}

.debug-modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.debug-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.debug-modal-header h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 16px;
}

.debug-modal-close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
  border: none;
  background: none;
}

.debug-modal-close:hover {
  color: #000;
}

.debug-modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.debug-modal-pre {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 13px;
  max-height: 60vh;
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  margin: 0;
  color: #2c3e50;
}

.close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .navbar {
    flex-direction: column;
    gap: 10px;
  }
  
  .navbar ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .debug-panel {
    width: 300px;
  }
}